#pragma once
#include "ComDef.h"
#include "game_util/event_mgr.h"

class RelaPlayer;

class FriendSys 
{
	RelaPlayer& m_owner;
	std::vector<uint64_t>& m_vecFriend; //引用DB 好友列表
	std::vector<uint64_t>& m_vecApplicant; //引用DB 申请列表
	std::vector<uint64_t>& m_vecBlacklist; //引用DB 黑名单列表

	su::Timer m_getFriendTimer;

public:
	FriendSys(RelaPlayer& player);

	void GetFriendList();
	void TouchFriend(); //读下关系玩家，避免内存释放

	void ApplyFriend(uint64 targetId);
	void AgreeFriend(uint64 targetId);
	void DelFriend(uint64 targetId);
	void DelBlackList(uint64 targetId);

	bool IsFriend(uint64 targetId);
	bool IsApplicant(uint64 targetId);
	bool IsBlackList(uint64 targetId);
};
